package swingtest;

import java.awt.Color;
import java.awt.Container;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.text.AbstractDocument.Content;

public class J_BoxLayout {

	public static void main(String[] args) {
		JFrame app = new JFrame("J_BoxLayout");
		app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		app.setSize(220, 130);
		app.setLocationByPlatform(true);
		Container container = app.getContentPane();
		container.setBackground(Color.green);
//		container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS));
		container.setLayout(new BoxLayout(container, BoxLayout.Y_AXIS));
		for (int i = 0; i < 4; i++) {
			JButton button = new JButton("button"+i);
			container.add(button);
		}
		app.setVisible(true);
	}

}
